package com.xsb.eventbusreflection_x;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.example.library.EventBus;
import com.example.library.annotation.Subscribe;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        EventBus.getDefault().register(this);
    }

    public void jump(View view) {
        startActivity(new Intent(this,SecondActivity.class));
    }

    @Subscribe()
    public void getMessage(String message){
        System.out.println(message);
        //Toast.makeText(this,message,Toast.LENGTH_SHORT).show();
    }
}